package com.ikas.ai.server.module.flow.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ikas.ai.server.module.flow.dao.FlowNodeHistoryDAO;
import com.ikas.ai.server.module.flow.model.FlowNodeHistory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 历史节点Service
 * @Author: qi.yilai
 * @Date: 2023/5/11 16:11
 * @Version: 1.0.0
 **/
@Service
public class FlowNodeHistoryService extends ServiceImpl<FlowNodeHistoryDAO, FlowNodeHistory> {

    /**
     * 获取流程实例的历史节点数据
     *
     * @param flowInstanceId
     * @return
     */
    public List<FlowNodeHistory> getFlowNodeHistories(Long flowInstanceId) {
        LambdaQueryWrapper<FlowNodeHistory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(FlowNodeHistory::getFlowInstanceId, flowInstanceId);
        return list(lambdaQueryWrapper);
    }
}
